local sk__bujiao = fk.CreateSkill {

  name = "sk__bujiao",

  tags = {  },

}



sk__bujiao:addEffect(fk.EventPhaseStart, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sk__bujiao.name) and target ~= player and target.phase == Player.Start and not target.dead
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, sk__bujiao.name, nil, "#sk__bujiao-invoke::"..target.id)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:doIndicate(player.id, {target.id})
    room:addPlayerMark(target, "@sk__taiping", 1)
    target:drawCards(1, sk__bujiao.name)
  end,
})

sk__bujiao:addEffect("maxcards", {
  name = "#sk__bujiao_maxcards",
  --sk__bujiao,
  correct_func = function(self, player)
    if player:getMark("@sk__taiping") > 0 then
      return -#table.filter(Fk:currentRoom().alive_players, function (p)
        return p:hasSkill(sk__bujiao.name)
      end) * player:getMark("@sk__taiping")
    end
  end,
})

return sk__bujiao